package com.iot.core.config;

import com.iot.core.manager.auth.AuthManager;
import com.iot.core.manager.htcls.HtClsManager;
import com.iot.core.manager.htctl.HtCtlManager;
import com.iot.core.manager.id.HtIdManager;
import com.iot.core.manager.id.SnowflakeIdWorker;
import com.iot.core.manager.job.DbJobManager;
import com.iot.core.manager.job.JobManager;
import com.iot.core.springboot.properties.FileProperty;
import com.iot.core.springboot.properties.ProjectInfoProperty;
import com.iot.core.springboot.properties.SnowflakeProperty;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Date;


@Configuration
public class MyprojectConfig {
    @Bean
    @ConfigurationProperties(prefix = "myproject.snowflake-property")
    public SnowflakeProperty snowflakeProperty() {
        return new SnowflakeProperty();
    }

    @Bean
    @ConfigurationProperties(prefix = "myproject.project-info-property")
    public ProjectInfoProperty projectInfoProperty() {
        return new ProjectInfoProperty();
    }

    @Bean
    @ConfigurationProperties(prefix = "myproject.file")
    public FileProperty fileProperty() {
        return new FileProperty();
    }

    @Bean
    public SnowflakeIdWorker snowflakeIdWorker(){
        return new SnowflakeIdWorker();
    }

    @Bean
    public HtIdManager htIdManager(){
        return new HtIdManager();
    }
    @Bean
    public  HtClsManager htClsManager(){
        return new HtClsManager();
    }

    @Bean
    public HtCtlManager htCtlManager(){
        return new HtCtlManager();
    }
    @Bean
    public AuthManager authManager(){
        return new AuthManager();
    }
    @Bean
    public JobManager jobManager(){
        return new JobManager();
    }
    @Bean
    public DbJobManager dbJobManager(){
        return new DbJobManager();
    }
}
